package com.nbsaas.boot.cms.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "文章评论", model = "文章评论")
@Entity
@Table(name = "bs_article_comment")
@Comment("文章评论表")
public class ArticleComment extends AbstractEntity {

    @Comment("文章ID")
    @FormField(title = "文章ID", sortNum = "1", grid = true, required = true)
    @Column(nullable = false)
    private Long articleId;

    @Comment("评论内容")
    @FormField(title = "评论内容", sortNum = "2", type = InputType.textarea, required = true)
    @Column(length = 2000, nullable = false)
    private String content;

    @Comment("评论者ID")
    @FormField(title = "评论者ID", sortNum = "3", grid = true)
    private Long userId;

    @Comment("评论者昵称")
    @FormField(title = "评论者昵称", sortNum = "4", grid = true)
    @Column(length = 100)
    private String userNickname;

    @Comment("评论者头像")
    @FormField(title = "评论者头像", sortNum = "5", type = InputType.image)
    @Column(length = 500)
    private String userAvatar;

    @Comment("评论者邮箱")
    @FormField(title = "评论者邮箱", sortNum = "6", grid = true)
    @Column(length = 200)
    private String userEmail;

    @Comment("评论者网站")
    @FormField(title = "评论者网站", sortNum = "7", grid = true)
    @Column(length = 500)
    private String userWebsite;

    @Comment("父评论ID")
    @FormField(title = "父评论ID", sortNum = "8", grid = true)
    private Long parentId;

    @Comment("回复用户ID")
    @FormField(title = "回复用户ID", sortNum = "9", grid = true)
    private Long replyUserId;

    @Comment("回复用户昵称")
    @FormField(title = "回复用户昵称", sortNum = "10", grid = true)
    @Column(length = 100)
    private String replyUserNickname;

    @Comment("评论状态")
    @FormField(title = "评论状态", sortNum = "11", grid = true, type = InputType.select)
    @Column(length = 20)
    private String status; // PENDING-待审核, APPROVED-已通过, REJECTED-已拒绝

    @Comment("审核时间")
    @FormField(title = "审核时间", sortNum = "12", type = InputType.date, grid = true)
    private Date auditTime;

    @Comment("审核人ID")
    @FormField(title = "审核人ID", sortNum = "13", grid = true)
    private Long auditorId;

    @Comment("审核备注")
    @FormField(title = "审核备注", sortNum = "14", type = InputType.textarea)
    @Column(length = 500)
    private String auditRemark;

    @Comment("点赞数")
    @FormField(title = "点赞数", sortNum = "15", grid = true, type = InputType.el_input_number, sort = true)
    private Integer likeCount;

    @Comment("IP地址")
    @FormField(title = "IP地址", sortNum = "16", grid = true)
    @Column(length = 50)
    private String ipAddress;

    @Comment("用户代理")
    @FormField(title = "用户代理", sortNum = "17")
    @Column(length = 500)
    private String userAgent;
} 